<%--
    Document   : statistics
    Created on : 7.5.2011, 11:38:03
    Author     : Football-Statistics Team
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="f" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml" %>

<f:setLocale value="${pageContext.request.locale}"/>
<f:setBundle basename="labelsBundle" />

<!DOCTYPE html>
<html>
    <head>
        <title><f:message key="project_title" /></title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <link rel="stylesheet" type="text/css" href="../css/main.css" media="screen" />
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js"></script>
        <script type="text/javascript" src="../js/superfish.js"></script>
        <script type="text/javascript" src="../js/hoverIntent.js"></script>
        <script type="text/javascript" src="../js/misc.js"></script>
        <script type="text/javascript" src="../js/jquery.tablesorter.min.js"></script>
        <title><f:message key="project_title" /></title>
    </head>
    <body>
        <div class="c">
            <header>
                <a id="logo" href="${pageContext.request.contextPath}/"></a>
            </header>
            <nav>
                <c:if test="${not empty xml_menu}">
                    <jsp:include page="menu.jsp">
                        <jsp:param name="section" value="statistics"/>
                    </jsp:include>
                </c:if>
            </nav>

            <section>
                <h1><f:message key="statistics" /></h1>
                <jsp:include page="statisticsNavigation.jsp"/>
                <h2><f:message key="players_statistics"/></h2>
                <jsp:include page="playerStatisticsNavigation.jsp"/>

                <c:if test="${param.cat=='teamSelect' or empty param.cat}">
                    <c:if test="${not empty xml_teams}">
                        <c:import url="XSLT/teamSelect.xsl" var="xslt"/>
                        <f:message key="select_team" var="select_team"/>
                        <f:message key="team" var="team"/>
                        <x:transform xml="${xml_teams}" xslt="${xslt}">
                            <x:param name="select_team" value="${select_team}"/>
                            <x:param name="team" value="${team}"/>
                            <x:param name="redirect" value="${pageContext.request.contextPath}/statistics/players-statistics?lid=${lid}&cat=team&team="/>
                        </x:transform>
                        <div id="chart_div"></div>
                    </c:if>
                </c:if>

                <c:if test="${param.cat=='team' or param.cat=='all'}">
                    <c:import url="XSLT/playersStatistics.xsl" var="xslt"/>
                    <f:message key="player" var="player"/>
                    <f:message key="team" var="team"/>                    
                    <f:message key="matches" var="matches"/>
                    <f:message key="minutes" var="minutes"/>
                    <f:message key="goals" var="goals"/>
                    <f:message key="red_cards" var="red_cards"/>
                    <f:message key="yellow_cards" var="yellow_cards"/>
                    <f:message key="all_teams" var="all_teams"/>
                    <x:transform xml="${xml}" xslt="${xslt}">
                        <x:param name="player" value="${player}"/>
                        <x:param name="team" value="${team}"/>
                        <x:param name="matches" value="${matches}"/>
                        <x:param name="minutes" value="${minutes}"/>
                        <x:param name="goals" value="${goals}"/>
                        <x:param name="red_cards" value="${red_cards}"/>
                        <x:param name="yellow_cards" value="${yellow_cards}"/>
                        <x:param name="all_teams" value="${all_teams}"/>
                        <x:param name="chosen_team" value="${param['team']}"/>
                    </x:transform>
                </c:if>
            </section>
        </div>
    </body>
</html>

